KML
- We have sketchy support for KML, the Keyhole Markup Language.
- There are many features in this file format that we don't yet
- support, but simple waypoint lists convert fine.
+ KML, the Keyhole Markup Language, is used by Keyhole and
+ Google Earth. (Google Earth uses GPSBabel internally for
+ receiver communications and several file format imports and
+ exports. There are features in this file format that we
+ don't support such as camera views, but waypoints, tracks, and
+ routes work well.
+
+ Additional options:
+ lines=n (default n=1) Draws lines between points in tracks and
+ routes when n is non-zero.
+ points=n (default n=1) Draws placemarks for tracks and routes when
+ n is non-zero.
+ line_width=n (default n=6) Width of drawn lines, in pixels.
+ line_color=n (default=65eeee17) Line colour specified in hex AABBGGRR.
+ floating=n (default n=0) Altitudes are not clamped to ground when
+ n is non-zero. This option is more useful to pilots than
+ to hikers.
+
GOOGLE
static char *opt_export_points = NULL;
static char *opt_line_width = NULL;
static char *opt_line_color = NULL;
+static char *opt_floating = NULL;
static int export_lines;
static int export_points;
+static int floating;
static waypoint *wpt_tmp;
{"line_color", &opt_line_color,
"Line color, specified in hex AABBGGRR",
"64eeee17", ARGTYPE_BOOL },
+ {"floating", &opt_floating,
+ "Altitudes are absolute and not clamped to ground",
+ "0", ARGTYPE_BOOL },
{0, 0, 0, 0, 0}
};
fprintf(ofd, "\t<Placemark>\n");
fprintf(ofd, "\t <styleUrl>%s</styleUrl>\n", style);
fprintf(ofd, "\t <Point>\n");
+ if (floating) {
+ fprintf(ofd, "\t <altitudeMode>absolute</altitudeMode>\n");
+ }
fprintf(ofd, "\t <coordinates>%f,%f,%f</coordinates>\n",
pt->longitude, pt->latitude, pt->altitude);
fprintf(ofd, "\t </Point>\n");
fprintf(ofd, "\t <name>Path</name>\n");
fprintf(ofd, "\t <MultiGeometry>\n");
fprintf(ofd, "\t <LineString>\n");
+ if (floating) {
+ fprintf(ofd, "\t <altitudeMode>absolute</altitudeMode>\n");
+ }
fprintf(ofd, "\t <coordinates>\n");
for (i = 0; i < point3d_list_len; ++i)
fprintf(ofd, "%f,%f,%f ",
// Parse options
export_lines = (0 == strcmp("1", opt_export_lines));
export_points = (0 == strcmp("1", opt_export_points));
+ floating = (!! strcmp("0", opt_floating));
fprintf(ofd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
fprintf(ofd, "<Document xmlns:xlink=\"http://www.w3/org/1999/xlink\">\n");